package com.dlc.shop.delivery.common.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dlc.shop.delivery.common.model.Printer;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 打印机
 * @author TRACK
 */
public interface PrinterMapper extends BaseMapper<Printer> {
    /**
     * 取消默认
     * @param shopId
     */
    void cancelDefault(@Param("shopId") Long shopId);

    /**
     * 设为/取消默认
     * @param printerId
     */
    void setDefault(@Param("printerId") Long printerId);

    /**
     * 获取店铺打印机列表
     * @param shopId
     * @return
     */
    List<Printer> listByShopId(@Param("shopId") Long shopId);

    /**
     * 校验名称
     * @param shopId
     * @param name
     * @param printerId
     * @return
     */
    int countByName(@Param("shopId") Long shopId, @Param("name") String name, @Param("printerId") Long printerId);
}
